package com.p2p.system.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.p2p.model.entity.Employee;
import com.p2p.model.entity.Vedioauth;
import com.p2p.model.vo.EmployeeQueryVo;
import com.p2p.system.common.Result;
import com.p2p.system.service.EmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 黄旭彬
 * @since 2023-12-14
 */
@CrossOrigin
@RestController
@Api(tags = "员工管理接口")
@RequestMapping("/system/employee")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @ApiOperation("获取员工表")
    @GetMapping("/{page}/{limit}")
    public Result getEmpInfoList(
            @PathVariable Long page,
            @PathVariable Long limit,
            EmployeeQueryVo employeeQueryVo
    ){
        Page<Employee> pageParam = new Page<>(page,limit);
        IPage<Employee> page1 = employeeService.selectEmpList(pageParam,employeeQueryVo);
        return Result.ok(page1);
    }
}

